/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.util.Collection;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author VietTien
 */
@Entity
@Table(name = "UserInfo", catalog = "BluePumpkin", schema = "dbo")
@NamedQueries({
    @NamedQuery(name = "UserInfo.findAll", query = "SELECT u FROM UserInfo u"),
    @NamedQuery(name = "UserInfo.findByUserID", query = "SELECT u FROM UserInfo u WHERE u.userID = :userID"),
    @NamedQuery(name = "UserInfo.findByUserPass", query = "SELECT u FROM UserInfo u WHERE u.userPass = :userPass"),
    @NamedQuery(name = "UserInfo.findByUserName", query = "SELECT u FROM UserInfo u WHERE u.userName = :userName"),
    @NamedQuery(name = "UserInfo.findByGender", query = "SELECT u FROM UserInfo u WHERE u.gender = :gender"),
    @NamedQuery(name = "UserInfo.findByBirthDay", query = "SELECT u FROM UserInfo u WHERE u.birthDay = :birthDay"),
    @NamedQuery(name = "UserInfo.findByEmail", query = "SELECT u FROM UserInfo u WHERE u.email = :email"),
    @NamedQuery(name = "UserInfo.findByAddressInfo", query = "SELECT u FROM UserInfo u WHERE u.addressInfo = :addressInfo"),
    @NamedQuery(name = "UserInfo.findByPhoneNumber", query = "SELECT u FROM UserInfo u WHERE u.phoneNumber = :phoneNumber"),
    @NamedQuery(name = "UserInfo.findByIsAdmin", query = "SELECT u FROM UserInfo u WHERE u.isAdmin = :isAdmin"),
    @NamedQuery(name = "UserInfo.findByIsFullControl", query = "SELECT u FROM UserInfo u WHERE u.isFullControl = :isFullControl"),
    @NamedQuery(name = "UserInfo.findByIsDelete", query = "SELECT u FROM UserInfo u WHERE u.isDelete = :isDelete")})
public class UserInfo implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "UserID", nullable = false, length = 10)
    private String userID;
    @Basic(optional = false)
    @Column(name = "UserPass", nullable = false, length = 20)
    private String userPass;
    @Column(name = "UserName", length = 50)
    private String userName;
    @Column(name = "Gender")
    private Boolean gender;
    @Column(name = "BirthDay")
    @Temporal(TemporalType.TIMESTAMP)
    private Date birthDay;
    @Column(name = "Email", length = 50)
    private String email;
    @Column(name = "AddressInfo", length = 200)
    private String addressInfo;
    @Column(name = "PhoneNumber", length = 20)
    private String phoneNumber;
    @Column(name = "IsAdmin")
    private Boolean isAdmin;
    @Column(name = "IsFullControl")
    private Boolean isFullControl;
    @Column(name = "isDelete")
    private Boolean isDelete;
    @OneToMany(cascade = CascadeType.ALL, mappedBy = "userInfo")
    private Collection<Feedback> feedbackCollection;

    public UserInfo() {
    }

    public UserInfo(String userID) {
        this.userID = userID;
    }

    public UserInfo(String userID, String userPass) {
        this.userID = userID;
        this.userPass = userPass;
    }

    public String getUserID() {
        return userID;
    }

    public void setUserID(String userID) {
        this.userID = userID;
    }

    public String getUserPass() {
        return userPass;
    }

    public void setUserPass(String userPass) {
        this.userPass = userPass;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public Boolean getGender() {
        return gender;
    }

    public void setGender(Boolean gender) {
        this.gender = gender;
    }

    public Date getBirthDay() {
        return birthDay;
    }

    public void setBirthDay(Date birthDay) {
        this.birthDay = birthDay;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getAddressInfo() {
        return addressInfo;
    }

    public void setAddressInfo(String addressInfo) {
        this.addressInfo = addressInfo;
    }

    public String getPhoneNumber() {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber) {
        this.phoneNumber = phoneNumber;
    }

    public Boolean getIsAdmin() {
        return isAdmin;
    }

    public void setIsAdmin(Boolean isAdmin) {
        this.isAdmin = isAdmin;
    }

    public Boolean getIsFullControl() {
        return isFullControl;
    }

    public void setIsFullControl(Boolean isFullControl) {
        this.isFullControl = isFullControl;
    }

    public Boolean getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Boolean isDelete) {
        this.isDelete = isDelete;
    }

    public Collection<Feedback> getFeedbackCollection() {
        return feedbackCollection;
    }

    public void setFeedbackCollection(Collection<Feedback> feedbackCollection) {
        this.feedbackCollection = feedbackCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (userID != null ? userID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserInfo)) {
            return false;
        }
        UserInfo other = (UserInfo) object;
        if ((this.userID == null && other.userID != null) || (this.userID != null && !this.userID.equals(other.userID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.UserInfo[userID=" + userID + "]";
    }

}
